package com.celesea.configuration.security.bean;


import java.io.Serializable;
import java.util.List;

public class Permission implements Serializable {
    private long id;

    private String code;

    private String name;

    private long parentId;

    private String levelId;

    private int type;

    private String url;

    private int sort;

    private int platform;

    private List<Permission> menu;

    public List<Permission> getMenu() {
        return menu;
    }

    public void setMenu(List<Permission> menu) {
        this.menu = menu;
    }

    public Permission() {
    }

    public long getId() {
        return id;
    }

    public void setId(long id) {
        this.id = id;
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public long getParentId() {
        return parentId;
    }

    public void setParentId(long parentId) {
        this.parentId = parentId;
    }

    public String getLevelId() {
        return levelId;
    }

    public void setLevelId(String levelId) {
        this.levelId = levelId;
    }

    public int getType() {
        return type;
    }

    public void setType(int type) {
        this.type = type;
    }

    public String getUrl() {
        return url;
    }

    public void setUrl(String url) {
        this.url = url;
    }

    public int getSort() {
        return sort;
    }

    public void setSort(int sort) {
        this.sort = sort;
    }

    public int getPlatform() {
        return platform;
    }

    public void setPlatform(int platform) {
        this.platform = platform;
    }

    @Override
    public String toString() {
        final StringBuilder sb = new StringBuilder("AuthPermission{");
        sb.append("id=").append(id);
        sb.append(", code='").append(code).append('\'');
        sb.append(", name='").append(name).append('\'');
        sb.append(", parentId='").append(parentId).append('\'');
        sb.append(", levelId='").append(levelId).append('\'');
        sb.append(", sortType=").append(type);
        sb.append(", url='").append(url).append('\'');
        sb.append(", sort=").append(sort);
        sb.append(", platform=").append(platform);
        sb.append('}');
        return sb.toString();
    }

    @Override
    public boolean equals(Object obj) {
        if (obj == null) {
            return false;
        }
        Permission permission= (Permission) obj;
        return this.code.equals(permission.getCode());
    }

    @Override
    public int hashCode() {
        return code.hashCode();
    }
}

